<template>
  <div>
    <oneStep v-if="showStop" :row-info="rowInfo" @submit="oneStepSubmit" @cancel="$emit('cancel')" />
    <towStep v-else :row-info="rowInfo" @close="backOneStep" @submit="towStepSubmit" />
  </div>
</template>

<script>
import { mapMutations } from 'vuex'
import oneStep from './step/oneStep.vue'
import towStep from './step/twoStep.vue'

export default {
  components: {
    oneStep,
    towStep
  },
  props: ['isUpload', 'rowInfo'],
  data() {
    return {
      showStop: true
    }
  },
  mounted() {
    if (this.isUpload) {
      this.showStop = false
    } else {
      this.showStop = true
    }
  },
  methods: {
    ...mapMutations('content', ['set_isResizeList']),
    oneStepSubmit() {
      this.showStop = false
      this.set_isResizeList()
    },
    hiddleLayer() {
      this.$emit('cancel')
    },
    backOneStep() {
      this.showStop = true
    },
    towStepSubmit() {
      this.hiddleLayer()
      this.set_isResizeList()
    }
  }
}
</script>
<style lang="scss" scoped>

</style>
